<title>文章编辑</title>
<style>

    .choosed, .tags {
        margin: 10px
    }

    .choosed + div {
        margin: auto;
        width: 250px;
        border-bottom: 1px solid rgba(2, 2, 2, .1)
    }


    .choose-tags span {
        display: inline-block;
        margin: 5px;
        padding: 3px;
        height: 30px;
        border-radius: 5px;
        cursor: pointer
    }

    .choose-tags span a {
        display: inline-block;
        margin: 3px
    }

    .choose-tags span:hover {
        opacity: .8
    }

    .choose-tag a {
        text-decoration: none
    }

    .tags-id, .choosetags > .choosed > span > span {
        display: none
    }
    .media-body {
        padding: 10px;
    }

.show-comm {
    -webkit-animation: comm .5s ;
    -moz-animation: comm .5s ;
    animation: comm .5s ;

}

    @-webkit-keyframes comm {
        0% {
            background-color: rgba(230, 247, 255, .1)
        }
        50% {
            background-color: rgba(230, 247, 255, .5)

        }
        100% {
            background-color: rgba(230, 247, 255, .7)

        }
    }

    @-moz-keyframes comm {
        0% {
            background-color: rgba(230, 247, 255, .1)
        }
        50% {
            background-color: rgba(230, 247, 255, .5)

        }
        100% {
            background-color: rgba(230, 247, 255, .7)


        }
    }

    @keyframes comm {
        0% {
            background-color: rgba(230, 247, 255, .1)
        }
        50% {
            background-color: rgba(230, 247, 255, .5)

        }
        100% {
            background-color: rgba(230, 247, 255, .7)


        }
    }






    .hidd-comm-backgroud {
        -webkit-animation: hidd-comm .5s ;
        -moz-animation: hidd-comm .5s ;
        animation: hidd-comm .5s ;

    }

    @-webkit-keyframes hidd-comm {
        0% {
            background-color: rgba(230, 247, 255, .7)
        }
        50% {
            background-color: rgba(230, 247, 255, .5)
        }
        100% {
            background-color: rgba(230, 247, 255, .1)
        }
    }

    @-moz-keyframes hidd-comm {
        0% {
            background-color: rgba(230, 247, 255, .7)
        }
        50% {
            background-color: rgba(230, 247, 255, .5)
        }
        100% {
            background-color: rgba(230, 247, 255, .1)
        }
    }

    @keyframes hidd-comm {
        0% {
            background-color: rgba(230, 247, 255, .7)
        }
        50% {
            background-color: rgba(230, 247, 255, .5)
        }
        100% {
            background-color: rgba(230, 247, 255, .1)
        }
    }
</style>

<div class="layui-card layadmin-header">
    <div class="layui-breadcrumb" lay-filter="breadcrumb">
        <a lay-href="">主页</a>
        <a><cite>文章管理</cite></a>
        <a><cite>文章编辑</cite></a>
    </div>
</div>
<script type="text/html" template>
    <link rel="stylesheet" href="{{ layui.setter.base }}style/jw_admin.css?v={{ layui.admin.v }}-1" media="all">
</script>
<div class="layui-fluid layui-form" id="layuiadmin-form-comment" lay-filter="layuiadmin-form-comment">
    <script type="text/html" template lay-url="/api/admin/article/edit/detail/{{ layui.router().search.id }}"
            lay-done="doEdit(d);">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md9 art-left">
                <div class="layui-card">
                    <div class="layui-card-header">
                        {{# if(d.data.status !== '91'){ }}
                        编辑文章
                        {{# } }}
                        {{# if(d.data.status === '91'){ }}
                        回收站文章预览 (此页面为回收站文章预览页面，信息不可编辑！)
                        {{# } }}

                    </div>
                </div>

                <div class="layui-card">
                    <div class="layui-card-body">
                        {{# if(d.data.status === '91'){ }}
                        <div>
                            <h1 style="font-weight: bold">{{ d.data.title }}</h1>
                        </div>
                        <span style="color: #aaa"> &nbsp;&nbsp;&nbsp;作者: {{ d.data.author }}</span>
                        {{# } }}
                        {{# if(d.data.status !== '91'){ }}
                        <div class="layui-form-item">
                            <input autocomplete="off" class="layui-input" id="art-title" name="title" placeholder="键入标题"
                                   type="text" lay-verify="required|maxLength" lay-max="100"
                                   value="{{ d.data.title }}">
                        </div>
                        <div class="layui-form-item">

                            <input autocomplete="off" class="layui-input" id="art-author"
                                   name="author" value="{{ d.data.author }}" lay-verify="required|maxLength"
                                   lay-max="10"
                                   placeholder="请输入作者"
                                   type="text">
                        </div>
                        <input type="hidden" name="tempData" id="tempData"
                               value="{{d.data.tempArticle && d.data.tempArticle.oid}}">
                        {{# } }}
                    </div>
                </div>
                {{# if(d.data.status === '91' && d.data.categoryName == null && d.data.artTagsList){ }}
                <div class="layui-card" style="color: #aaa">
                    <div class="layui-card-header">
                        <span style="color: #aaa">{{ d.data.categoryName == null ? "" : ("类别: " + d.data.categoryName) }}</span>
                        {{# if(d.data.artTagsList){ }}
                        <span style="color: #aaa">标签:</span>
                        {{# } }}
                        {{# layui.each(d.data.artTagsList, function(index, item){ }}
                        <span style="color: #aaa">
                                 {{#  if(index !== 0){ }}
                                  ,
                                 {{#  } }}
                                {{ item.name}}
                            </span>
                        {{# }); }}
                    </div>
                </div>
                {{# } }}
                <div class="layui-card">
                    <div class="layui-card-body" id="article-content">
                        <textarea id="article-content-text-edit" name="article"></textarea>
                    </div>
                </div>
                {{# if(d.data.status !== '91'){ }}
                <div class="layui-card">
                    <div class="layui-card-body">
                        <div class="art-comment" id="art-comment">
                            <div class="add-comment-btn">
                                <button class="layui-btn add-comment">添加评论</button>
                            </div>
                            <div class="comment-input" style="display: none">
                                <div class="layui-form-item layui-form-text">
                               <textarea class="layui-textarea" id="comm-content" name="comm-content"
                                         placeholder="请输入内容"></textarea>
                                </div>
                                <div class="layui-form-item">
                                    <div class="layui-input-right">
                                        <button class="comment-btn layui-btn" id="addComment">提交评论</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                {{# } }}

                <div class="layui-card commentView-card">
                    <div class="layui-card-body">
                        <!--                        comment-->
                        <div class="commentView" id="commentView"></div>
                    </div>
                    <div>
                        <input type="hidden" name="artOid" id="artOid" value="{{d.data.id}}">
                    </div>
                </div>


            </div>
            <div class="layui-col-md3 art-right-side">
                <div class="layui-card">
                    <div class="layui-card-header">文章标签</div>
                    <div class="layui-card-body">
                        <div class="choose-tags">
                            <div class="choosed">
                                {{# layui.each(d.data.artTagsList, function(index, item){ }}
                                <span class="publish-tags-content" data-id="{{ item.id }}"
                                      data-text="{{ item.name }}">{{ item.name}}<a>×</a>
                                     </span>
                                {{# }); }}

                            </div>
                            <div class="separation-line"></div>
                            <div class="tags">
                                {{# layui.each(d.data.allTagsList, function(index, item){ }}
                                <span class="publish-tags-content" data-id="{{ item.id }}"
                                      data-text="{{ item.name }}">{{ item.name}}</span>
                                {{# }); }}
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-card">
                    <div class="layui-card-header">文章分类</div>
                    <div class="layui-card-body">
                        <div class="article-type">
                            <div class="layui-card layui-form" lay-filter="component-form-element" id="type-select">
                                <select lay-search lay-verify="required" name="categoryId" id="categoryId">
                                    <option style="font-weight: bold;color: black" value="-1"></option>
                                    {{# layui.each(d.data.categoryList, function(index, item){ }}
                                    <optgroup label="{{ item.name }}"/>
                                        {{# layui.each(item.subCategoryList, function(subIdx, sub){ }}
                                        <option style="color: #777" value="{{ sub.id }}" {{# if(sub.id=== d.data.categoryId){
                                                }} selected {{# } }}>{{ sub.name }}
                                        </option>
                                        {{# }); }}
                                    {{# }); }}


                                </select>
                            </div>
                        </div>

                    </div>
                </div>
                <div class="layui-card">
                    <div class="layui-card-header">缩略图</div>
                    <div class="layui-card-body">
                        <div class="article-img">
                            <div class="layui-upload">
                                <button class="layui-btn" id="test1" type="button">上传图片</button>
                                <div class="layui-upload-list imgupload">
                                    <img class="pre-upd-img" id="breimg" style="margin-left: 5px" width="100"
                                         src="{{ d.data.imgSrc }}">
                                    <p id="demoText"></p>
                                    <input id="imgsrc" name="imgsrc" style="visibility: hidden" value=""/>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
                <div class="layui-card">
                    <div class="layui-card-header">操作</div>
                    <div class="layui-card-body">
                        <div class="published-btns-opt">
                            <div class="article-status">
                               <span style="text-space: 2">&nbsp;&nbsp;当前状态:
                                    {{#  if(d.data.status === '90'){ }}
                                     已发布
                                    {{#  } }}
                                    {{# if(d.data.status === '00'){ }}
                                    草稿
                                    {{#  } }}
                                    {{# if(d.data.status === '91'){ }}
                                    回收站
                                    {{#  } }}
                                   </span>
                            </div>
                            <div class="separation-line"></div>
                            <a><i class="iconfont">&#xe606;</i> 公开度：
                                <span id="published-public">
                            {{#  if(d.data.accessType === '11'){ }}
                                密码
                            {{#  } }}
                            {{# if(d.data.accessType === '10'){ }}
                                私密
                            {{#  } }}
                            {{# if(d.data.accessType === '20'){ }}
                                公开

                            {{#  } }}

                            {{# if(d.data.topPlaceFlag){ }}
                                (置顶)
                            {{#  } }}
                            </span></a>&nbsp;
                            <a id="edit">编辑</a>
                            <form class="layui-form" lay-filter="component-form-element" method="post">
                                <div class="layui-form-item" id="ispublic-form">
                                    <div class="layui-input-block">
                                        <input {{# if(d.data.accessType== 20){ }} checked {{# }
                                               }}
                                               class="ispublic-radio" id="public" lay-filter="public"
                                               name="isPublic" title="公开"
                                               type="radio" value="20">
                                        <span id="hometop1"><input id="hometop" lay-skin="primary" title="将文章置于首页顶端"
                                                                   type="checkbox"
                                                                   {{# if(d.data.topPlaceFlag){ }} checked {{# } }}
                                                                   value="1" name="hometop"></span><br>
                                        <input class="ispublic-radio" id="passw" lay-filter="passw" name="isPublic"
                                               title="密码保护" {{# if(d.data.accessType== 11){ }} checked {{# } }}
                                               type="radio"
                                               value="11">
                                        <input autocomplete="off" class="layui-input wd80p" id="passw-content"
                                               {{# if(d.data.accessType !=11){ }} style="display: none" {{# } }}
                                               value="{{d.data.password}}"
                                               placeholder="密码"
                                               type="password">
                                        <input autocomplete="off" class="layui-input wd80p" id="passw-content-confirm"
                                               placeholder="确认密码"
                                               {{# if(d.data.accessType !=11){ }} style="display: none" {{# } }}
                                               type="password"><br>
                                        <input class="ispublic-radio" id="secret" lay-filter="secret" name="isPublic"
                                               title="私密" {{# if(d.data.accessType== 10){ }} checked {{# } }}
                                               type="radio" value="10">

                                    </div>
                                    <span id="pwd-tips" style="color: red;display: none"></span>
                                    <div class="btns-opt" id="btns0" style="display: block">
                                        <button class="layui-btn layui-btn-sm" id="btn-ispublic-sure">确定</button>
                                        <button class="layui-btn layui-btn-primary layui-btn-sm"
                                                id="btn-ispublic-cancel">
                                            取消
                                        </button>
                                    </div>
                                </div>
                                <div>
                                    <div id="isComment">
                                        <input id="is-comment" name="isComment" title="是否可以评论"
                                               {{# if(d.data.isComment=== true){ }} checked {{# } }} type="checkbox">
                                    </div>
                                </div>
                                <div>
                                    <div id="isOriginal">
                                        <input id="is-original" name="flagOriginal" title="是否原创" lay-filter="original"
                                               {{# if(d.data.flagOriginal=== true){ }} checked {{# } }} type="checkbox">
                                    </div>
                                    <div id="originalUrl" {{# if(d.data.flagOriginal=== true){ }} style="display: none" {{# } }}>
                                        <input class="layui-input wd80p" id="original-url" lay-verify="urlFmt|maxLength" lay-max="100" placeholder="转载源链接" name="originalUrl" value="{{ d.data.originalUrl }}" title="转载源链接" type="text">
                                    </div>
                                </div>
                            </form>
                            <div class="separation-line"></div>
                            <div class="btn-group">
                                <div class="negative-btn">
                                    <button class="layui-btn layui-btn-primary" id="cancel">重置</button>
                                    {{# if(d.data.status !== '91'){ }}
                                    <button class="layui-btn layui-btn-danger wd50p" id="remove-del"
                                            lay-filter="submit-article"
                                            lay-submit>移至回收站
                                    </button>
                                    {{# } }}

                                </div>
                                <div class="positive-btn">
                                    {{# if(d.data.status === '00'){ }}
                                    <button class="layui-btn layui-btn-primary" id="published-save"
                                            lay-filter="submit-article" lay-submit>保存
                                    </button>
                                    {{# } }}
                                    {{# if(d.data.status === '00'){ }}
                                    <button class="layui-btn positive-btn-right wd50p" id="published-pub"
                                            lay-filter="submit-article" lay-submit>发布
                                    </button>
                                    {{# } }}
                                    {{# if(d.data.status === '90'){ }}
                                    <button class="layui-btn positive-btn-right wd50p" id="published-update"
                                            lay-filter="submit-article" lay-submit>更新
                                    </button>
                                    {{# } }}


                                </div>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </script>
    <script type="text/html" template lay-url="/api/admin/request/token/generate"
            lay-data="{pageId: 'A12'}" lay-type="post" lay-done="doUpdateToken(d);">
        <input type="hidden" name="subToken" id="subToken" value="{{d.token}}">
    </script>

</div>

<script id="commentTemplate" type="text/html">

    <div class="comment-content ">
        {{# layui.each(d, function(index, comm){ }}
        <div class="comment-list">
            <div class="media-body" id="comm-{{comm.oid}}">
                <a href="javascript:" class="media-left" style="float: left;">
                    <img src="{{ comm.avatarSrc }}" height="46px"
                         width="46px">
                </a>
                <div class="pad-btm">
                    <p class="fontColor">
                        <a href="javascript:">{{ comm.userNick }}</a>
                        <span style="float: right">
                                            <button class="layui-btn layui-btn-sm reply"
                                                    data-id="{{ comm.oid}}">回复</button>
                                            <button class="layui-btn layui-btn-sm layui-btn-danger del"
                                                    data-id="{{ comm.oid}}">删除</button>
                                        </span>
                    </p>
                    <p class="min-font">
                        <a href="javascript:" style="font-size: 12px">{{ comm.commentTimeDesc }}</a>
                    </p>
                </div>
                <p class="message-text">{{=comm.content}}</p>
            </div>
            <div class="comment-content-reply">
                {{# layui.each(comm.replyList, function(index, rep){ }}
                <div>
                    <div class="media-body" id="comm-{{rep.oid}}">
                        <a href="javascript:" class="media-left" style="float: left;">
                            <img src="{{rep.avatarSrc}}" height="46px"
                                 width="46px">
                        </a>
                        <div class="pad-btm">
                            <p class="fontColor">
                                <a href="javascript:">{{rep.userNick}}</a>
                                <a href="javascript:">回复 @{{rep.parentUserName}}</a>
                                <span style="float: right">
                                                        <button class="layui-btn layui-btn-sm reply"
                                                                data-id="{{ rep.oid}}">回复</button>
                                                        <button class="layui-btn layui-btn-sm layui-btn-danger del"
                                                                data-id="{{ rep.oid}}">删除</button>
                                </span>
                            </p>
                            <p class="min-font">
                                <a href="javascript:" style="font-size: 12px">{{rep.commentTimeDesc}}</a>
                            </p>
                        </div>
                        <p class="message-text">{{=rep.content}}</p>
                    </div>
                </div>
                {{# }); }}
            </div>
        </div>
        {{# }); }}
    </div>


</script>

<script>
    var timer;

    doEdit = function (d) {
        layui.use('articleEdit', layui.factory('articleEdit'))
            .use('comment', layui.factory('comment'))
            .use(['admin', 'articleEdit', 'form', 'table', 'element', 'comment'], function () {
                var $ = layui.jquery
                    , form = layui.form
                    , element = layui.element
                    , articleEdit = layui.articleEdit
                    , admin = layui.admin
                    , setter = layui.setter
                ;
                var artOid = layui.router().search.id;
                var isChange = false;
                element.render()
                form.render()
                var tempOid = null;
                //回收站view
                if (d.data.status === "91") {
                    console.log("===回收站===")
                    $('input').attr('disabled', 'disabled')
                    $('input').css('border', 'none')
                    $('.art-right-side').hide()
                    $('button').hide()
                    $('.art-left').removeClass('layui-col-md9')
                    $('#article-content-text-edit').hide()
                    $('#article-content').html(d.data.content)
                }
                if (d.data.status !== "91") {

                    var edit = articleEdit.getEdit(function () {
                        isChange = true
                    }, function (opt, edit) {
                        edit.setContent(d.data.content);
                    });

                    // edit.setContent('<strong>Some contents</strong>');
                    var tags = $('.choose-tags').find('.publish-tags-content');
                    tags.each(function (i) {
                        var color = Math.random();
                        var r = parseInt((color * (i + 1) * 1234) % 254);
                        var g = parseInt((color * (i + 1) * 4321) % 254);
                        var b = parseInt((color * (i + 1) * 2222) % 254);
                        $(this).css("background-color", "rgba(" + r + "," + g + "," + b + ",0.1)")
                        $(this).css("border", "  1px rgba(" + r + "," + g + "," + b + ",1) solid")
                    })


                    $("input[name=title],input[name=author]").change(function () {
                        isChange = true;
                    })

                    window.onunload = function () {
                        saveTempArticle();
                    }
                    admin.on('refresh', function (router) {
                        saveTempArticle()
                    });

                    admin.on('hash(article)', function (router) {

                        if (admin.prevRouter && admin.prevRouter.href.startsWith('/article/edit')) {
                            saveTempArticle();
                        }
                    });

                    if (timer) {
                        clearInterval(timer)
                    }


                    //每30秒保存一次
                    timer = setInterval(function () {
                        saveTempArticle();
                    }, setter.saveArticleTime);

                }

                renderComm(artOid, function () {
                    if (d.data.status === "91") {
                        $('button').hide();
                    }

                    if (layui.router().search.c)
                    {
                         var t = setTimeout(function () {
                            $('#'+cid).addClass('hidd-comm-backgroud')

                    }, 500);

                        var cid=layui.router().search.c;

                        var commEl = document.getElementById(cid);
                        if (commEl) {
                            commEl.scrollIntoView()
                        }
                        $('#'+cid).addClass('show-comm')
                    }



                });

                if (d.data.tempArticle && d.data.tempArticle.oid) {
                    alertAsk('系统存在之前未完成的临时文章，是否恢复?', function () {
                        var tmpData = d.data.tempArticle;
                        var index = layer.load(0, {shade: false, offset: '400px'});
                        $('input[name=title]').val(tmpData.title);
                        $('input[name=author]').val(tmpData.author);
                        $('select[name=categoryId]').val(tmpData.categoryId);
                        $('input[name=imgsrc]').val(tmpData.imgSrc);
                        $('input[name=originalUrl]').val(tmpData.originalUrl);
                        var publicStr = "公开"
                        if (tmpData.accessType === "11") {
                            publicStr = "密码";
                        } else if (tmpData.accessType === "10") {
                            publicStr = "私密";
                        }
                        if (tmpData.topPlaceFlag) {
                            publicStr += "(置顶)";
                        }
                        $('#published-public').text(publicStr)
                        $('input[name=isPublic][value="' + tmpData.accessType + '"]').attr("checked", true);
                        if (tmpData.topPlaceFlag) {
                            // $('input[name=isPublic][value="20"]').attr("checked", true);
                            $('input[name=hometop]').attr("checked", true);
                        }
                        if (tmpData.accessType === "11") {
                            $('#passw-content').val(tmpData.password)
                            // $('#hometop1').hide();
                            $('#passw-content').show();
                            $('#passw-content-confirm').show();
                        }
                        $('#breimg').attr('src', tmpData.imgSrc);
                        if (tmpData.isComment) {
                            $('input[name=isComment]').attr("checked", true);
                        } else {
                            $('input[name=isComment]').removeAttr("checked");
                        }

                        if (tmpData.flagOriginal) {
                            $('input[name=flagOriginal]').attr("checked", true);
                        } else {
                            $('input[name=flagOriginal]').removeAttr("checked");
                        }

                        form.render();
                        edit.setContent(tmpData.content);
                        var tagsHtml = "";
                        if (tmpData.artTagsList) {
                            layui.each(tmpData.artTagsList, function (key, item) {
                                tagsHtml += '<span class="publish-tags-content" ' +
                                    'data-id="' + item.id + '" data-text="' + item.name + '">' + (item.name) + '<a>×</a></span>';
                            })
                            $('.choosed').html(tagsHtml);
                            var tags = $('.choosed').find('.publish-tags-content');
                            tags.each(function (i) {
                                var color = Math.random();
                                var r = parseInt((color * (i + 1) * 1234) % 254);
                                var g = parseInt((color * (i + 1) * 4321) % 254);
                                var b = parseInt((color * (i + 1) * 2222) % 254);
                                $(this).css("background-color", "rgba(" + r + "," + g + "," + b + ",0.1)")
                                $(this).css("border", "  1px rgba(" + r + "," + g + "," + b + ",1) solid")
                            })
                        }
                        else {
                            $('.choosed').html("");
                        }
                        layer.close(index);

                    }, function () {
                        ajaxPost('/api/admin/article/temp/update/void',
                            1,
                            JSON.stringify({
                                entityOid: d.data.tempArticle.oid
                            }));
                        d.data.tempArticle.oid = null;
                        tempOid = null;
                        $('#tempData').val(null);

                    })

                }

                function saveTempArticle() {
                    if (!isChange) return '';
                    var title = $('input[name=title]').val();
                    var author = $('input[name=author]').val();
                    var categoryId = $('select[name=categoryId]').val();
                    var subToken = $('input[name=subToken]').val();
                    var imgsrc = $('input[name=imgsrc]').val();
                    var originalUrl = $('input[name=originalUrl]').val();
                    var isPublic = $('input[name=isPublic]:checked').val();
                    var articleContent = tinyMCE.activeEditor.getContent();
                    var tagsId = [];
                    var data = $('.choosed>span')
                    for (let i = 0; i < data.length; i++) {
                        let o = {};
                        o.id = data.eq(i).data('id');
                        o.name = data.eq(i).data('text');
                        tagsId.push(o)
                    }
                    var publishTemp = isPublic;
                    var passw = '';
                    var topPlaceFlag = false;
                    if ($('#hometop').prop('checked')) {
                        topPlaceFlag = true;
                    }

                    if (publishTemp === '11') {
                        passw = $('#passw-content').val();
                    }
                    var iscomment = 0;
                    if ($('#is-comment').prop('checked')) {
                        iscomment = 1;
                    }
                    var flagOriginal = 0;
                    if ($('#is-original').prop('checked')) {
                        flagOriginal = 1;

                    }
                    if (d.data.tempArticle && d.data.tempArticle.oid) {
                        tempOid = d.data.tempArticle.oid;
                    }

                    ajaxPost('/api/admin/article/temp/save',
                        1,
                        JSON.stringify({
                            requestId: subToken,
                            oid: tempOid,
                            oldArticleOid: artOid,
                            title: title,
                            author: author,
                            articleContent: articleContent,
                            tags: tagsId,
                            categoryId: categoryId,
                            imgSrc: imgsrc,
                            accessType: publishTemp,
                            password: passw,
                            originalUrl: originalUrl,
                            isComment: iscomment !== 0,
                            flagOriginal: flagOriginal !== 0,
                            topPlaceFlag: topPlaceFlag,
                            pageType: "20",

                        }),
                        null,
                        function (res) {
                            if (!tempOid) {
                                tempOid = res.oid;
                                $('#tempData').val(tempOid);
                            }
                        });
                }





            })
    }


    doUpdateToken = function (d) {
    }

</script>